import React, { FC } from 'react'
// import styles from './List.module.scss'
import { Outlet } from 'react-router-dom'
import {Spin} from 'antd'
import useLoadUserData from '../hooks/useLoadUserData'
import useNavPage from '../hooks/useNavPage'

const QuestionLayout: FC = () => {
  const { waitingUserData } = useLoadUserData()
  useNavPage(waitingUserData)
  return (
    <>
      <div>question layout</div>
      <div>
      { waitingUserData ? <div style={{'textAlign': 'center', 'marginTop': '100px'}}><Spin /></div> : <Outlet /> }
      </div>
    </>
  )
}

export default QuestionLayout